Web App Development Book: Guide to Ember.js by David V

Web App Development Book: Guide to Ember.js by David V

Author:David V. [V., David]
Language: eng
Format: epub
Publisher: UNKNOWN
Published: 2016-08-27T22:00:00+00:00


Customizing Serializers

In Ember data, “JSONAPISerializer” is used by default, but a custom serializer can be used for the purpose of overriding this. A custom serializer can be defined in two main ways. One can choose to define a custom serializer for the entire application by definition of the “application” serializer. This is shown in the code given below:

import DS from 'ember-data';

export default DS.JSONSerializer.extend({});

A serializer can also be defined for a specific model. A good example is when you have a “post” model, it is possible for you to also define a “post” serializer. This is shown in the code given below:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.